#pragma once

#include "molecular_atom.h"
#include "models/atom_interface/ai_hotkey_manager.h"
#include <map>

class HotkeyManager :
    public M::Atom
{
public:
    HotkeyManager();
    virtual ~HotkeyManager();

    virtual M::String name() const { return PAN_HOTKEY_MANAGER; }
    virtual bool OnExecute(const M::AtomEndPoint &oSrcAtom, int nFuncId, void *pParams, void *pIOParams);

protected:
    bool OnSetHotkeyWindow(HWND hWindow);
    bool OnCreateHotkey(const M::AtomEndPoint &oSrcAtom, PokeHotkeyInfo *pHotkeyInfo);
    bool OnDestroyHotkey(int nHotkeyId);
    bool OnPublishHotKey(int nHotkeyId, PokeHotkeyKey *pHotkeyKey);
    bool OnHotkey(int nHotkeyId);
    bool OnGetHotkey(int nHotkeyId, PokeHotkey *pHotkey);
    bool OnGetHotkeyByDesc(CString *pDesc, PokeHotkey *pHotkey);
    bool OnGetAllHotkey(PokeHotkeyList *pHotkeyList);

    bool Register(int nHotkeyId, PokeHotkeyKey *pHotkeyKey);
    bool Unregister(int nHotkeyId);

private:
    HWND m_hWindow;
    PokeHotkeyList m_vHotkeyList;
};